import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import TypeNav from "@comp/TypeNav";
import Swiper from "@comp/Swiper";
import Pagination from "@comp/Pagination";
import "@/mock/mockServer"; // 加载mockServer即可
import "@/utils/validate"; // 加载自定义的校验规则
import "@/utils/elementUI"; // 加载elementUI
import "@/utils/lazyload"; // 加载图片懒加载

Vue.config.productionTip = false;

// 注册全局组件TypeNav
Vue.component("TypeNav", TypeNav);
// 注册全局Swiper
Vue.component("Swiper", Swiper);
// 注册全局Pagination
Vue.component("Pagination", Pagination);

new Vue({
    render: h => h(App),
    beforeCreate() {
        // 绑定事件总线对象
        Vue.prototype.$bus = this;
    },
    router, // 配置路由器
    store, // 配置vuex的store
}).$mount("#app");
